<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //求1-100之间所有的平均数
            var sum =0;
        for(var i =0 ; i<=100 ;i++){
            sum+=i;
        }
        
        var avg = sum/100;
        alert(avg);
        //求1-100所有奇数和偶数的和
        var even = 0;
        var add =0;
        for(var i=0;i<=100;i++){
            if(i%2==0){
               even=even+i;
            }else{
                odd=add+i;
            }
        }
        console.log(even);
        console.log(odd);
        //求1-100中能被3整除的数
        var z =0;
        for(var i=1;i<=100;i++){
            if (i%3==0) {
                z=z+i;
            }
                
        }
        console.log(z);
    </script>
</body>
</html>